from ..models.fund_channel import FundChannel


class FundChannelService:
    @classmethod
    def get_list(cls, *args, **kwargs):
        query = FundChannel.query
        if 'status' in kwargs:
            query = query.filter(FundChannel.status == kwargs.pop('status'))

        return query.all()

    @classmethod
    def get_channel_by_id(cls, id):
        return FundChannel.query.filter(FundChannel.id == id).first()
